﻿using OASystem.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.SessionState;

namespace OASystem.Models
{
    /// <summary>
    /// 管理员的上下文
    /// </summary>
    public class AdminContext
    {
        /// <summary>
        /// 设置key值
        /// </summary>
        private const string sessionKey = "AdminInfo_session_Key";
        public HttpSessionState httpSession => HttpContext.Current.Session;
        /// <summary>
        /// 设置静态 上下文
        /// </summary>
        public static AdminContext context = new AdminContext();
        /// <summary>
        /// 设置用户表
        /// </summary>

        public Userinfo adminUser
        {
            get
            {
                return httpSession[sessionKey] as Userinfo;
            }
            set
            {
                httpSession[sessionKey] = value;
            }
        }
    }
}